﻿@using FwProject.Web.Startup
@using Abp.Timing
@using Abp.Web.Mvc.Models
@{
    ViewBag.CurrentPageName = PageNames.Home; // The menu item will be active for this page.
    ViewBag.BodyCss = "fixed-sidebar full-height-layout gray-bg";
}

@section styles{
    @*<link href="~/lib/morris.js/morris.css" rel="stylesheet" asp-append-version="true" />*@
    <link href="~/css/style-index.css" rel="stylesheet" />
    <style type="text/css">
        body {
            overflow: hidden;
        }

        .navbar-logo {
            width: 220px;
            height: 60px;
        }

        .font-bold, .text-muted, .caret {
            color: #fff;
            text-align: center;
        }
    </style>
}
@*@section scripts
        {
        <environment names="Development">
            <script src="~/lib/jquery-countTo/jquery.countTo.js" asp-append-version="true"></script>
            <script src="~/lib/raphael/raphael.js" asp-append-version="true"></script>
            <script src="~/lib/morris.js/morris.js" asp-append-version="true"></script>
            <script src="~/lib/chart.js/dist/Chart.bundle.js" asp-append-version="true"></script>
            <script src="~/lib/Flot/jquery.flot.js" asp-append-version="true"></script>
            <script src="~/lib/Flot/jquery.flot.resize.js" asp-append-version="true"></script>
            <script src="~/lib/Flot/jquery.flot.pie.js" asp-append-version="true"></script>
            <script src="~/lib/Flot/jquery.flot.categories.js" asp-append-version="true"></script>
            <script src="~/lib/Flot/jquery.flot.time.js" asp-append-version="true"></script>
            <script src="~/lib/jquery-sparkline/dist/jquery.sparkline.js" asp-append-version="true"></script>
            <script src="~/view-resources/Views/Home/Index.js" asp-append-version="true"></script>
        </environment>

        <environment names="Staging,Production">
            <script src="~/view-resources/Views/_Bundles/home-index.min.js" asp-append-version="true"></script>
        </environment>
    }*@


<div id="wrapper">
    <!--左侧导航开始-->
    <nav class="navbar-default navbar-static-side" role="navigation">
        <div class="nav-close">
            <i class="fa fa-times-circle"></i>
        </div>
        <div class="sidebar-collapse">
            <ul class="nav" id="side-menu">
                @*@Html.ActionLinke("NavMenu", "Layout", new { activeMenu = "" })*@
                @await Component.InvokeAsync("NavMenu", new { activeMenu = "" })
            </ul>
        </div>
    </nav>
    <!--左侧导航截止-->
    <!--右侧部分开始-->
    <div id="page-wrapper" class="gray-bg dashbard-1">
        <div class="row border-bottom">
            <div id="main">
                <div id="main-hd">
                    <a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i> </a>
                    <div id="main-hd-title">
                        <a>饭碗易购后台管理系统</a>
                    </div>
                    <ul id="topnav">
                        <li class="list">
                            <a onclick="openTab('00154','待办任务','/Home/PendingTask')" target="_blank"><span><i class="glyphicon glyphicon-tasks"></i></span>待办任务</a>
                        </li>
                        <li class="list">
                            <a onclick="openTab('001010','工厂配送情况','/DistributionReport/DeliverySituation')" target="_blank"><span><i class="fa fa-bus"></i></span>配送情况</a>
                        </li>
                        <li class="list">
                            <a onclick="openTab('00101010101','实时配送率','/DistributionReport/DriverActualRatio')" target="_blank"><span><i class="fa fa-bicycle"></i></span>配送率</a>
                        </li>
                        <li class="list">
                            <a id="nav_home" href="@Url.Action("Index")" target="_blank"><span><i class="fa fa-home"></i></span>系统首页</a>
                        </li>
                        <li class="list">
                            <a onclick="Refresh()"><span><i class="fa fa-refresh"></i></span>刷新页面</a>
                        </li>
                        <li class="list">
                            <a href="@Url.Action("Logout", "Account")"><span><i class="fa fa-power-off"></i></span>安全退出</a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="row content-tabs">
            <button class="roll-nav roll-left J_tabLeft">
                <i class="fa fa-backward"></i>
            </button>
            <nav class="page-tabs J_menuTabs">
                <div class="page-tabs-content">
                    <a href="javascript:;" class="active J_menuTab" data-id="/Home/Note/">主页</a>
                </div>
            </nav>
            <button class="roll-nav roll-right J_tabRight">
                <i class="fa fa-forward"></i>
            </button>
            <div class="btn-group roll-nav roll-right">
                <button class="dropdown J_tabClose" data-toggle="dropdown">
                    关闭操作<span class="caret"></span>
                </button>
                <ul role="menu" class="dropdown-menu dropdown-menu-right">
                    <li class="J_tabShowActive">
                        <a>定位当前选项卡</a>
                    </li>
                    <li class="divider"></li>
                    <li class="J_tabCloseAll">
                        <a>关闭全部选项卡</a>
                    </li>
                    <li class="J_tabCloseOther">
                        <a>关闭其他选项卡</a>
                    </li>
                </ul>
            </div>
            <a href="@Url.Action("Logout", "Account")" class="roll-nav roll-right J_tabExit"><i class="fa fa-sign-out"></i>退出</a>
        </div>
        <div class="row J_mainContent" id="content-main">
            <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="/Home/Note/" frameborder="0" data-id="/Home/Note/" seamless></iframe>
        </div>
        <div class="footer">
            <div class="pull-right">
                &copy; @DateTime.Now.Year <a href="http://www.baidu.com" target="_blank">饭碗易购后台管理系统</a>
            </div>
        </div>
    </div>
    <!--右侧部分截止-->
</div>
@section scripts{
    <script src="~/Theme/js/plugins/metisMenu/jquery.metisMenu.js"></script>
    <script src="~/Theme/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
    <script src="~/Theme/js/hplus.min.js?v=4.1.0"></script>
    <script src="~/Theme/js/contabs.min.js" type="text/javascript"></script>
    <script src="~/Theme/js/plugins/pace/pace.min.js"></script>

    <script type="text/javascript">

        function openTab(idx, title, url) {
            var $sb = $('<li class="hidden"><a class="J_menuItem" href="' + url + '" data-index="' + idx + '"><i class="fa fa-file-text-o"></i><span class="nav-label">' + title + '</span></a></li>').appendTo($("#side-menu"/*, top.window.document*/));
            $sb.children("a").get(0).click();
            $sb.remove();
        }
        function closeAndRefreshTab(closeId, refreshId) {
            if ($("a.J_menuTab[data-id='" + closeId + "'] i").length==0) {
                $("a.active.J_menuTab i").get(0).click();
            } else {
                $("a.J_menuTab[data-id='" + closeId + "'] i").get(0).click();
            }
            if (refreshId) {
                var $menuTab = $("#J_menuItem[href='" + refreshId + "']");
                if ($menuTab.length > 0)
                    $menuTab.get(0).click();
                var refreshTab = $("iframe.J_iframe[data-id='" + refreshId + "']").get(0);
                if (refreshTab)
                    refreshTab.src = refreshTab.src;
            }
        }
        function ChangePasswordCallback(data) {
            if (data.success) {
                layer.msg(data.result, {
                    icon: 1,
                    time: 1000
                }, function () {
                    location.href = "@Url.Action("Logout", "Account")";
                });
            }
            else {
                layer.msg(data.error.message + (data.error.validationErrors.length == 0 ? "" : "，" + data.error.validationErrors[0].message), {
                    icon: data.error.code,
                });
            }
        }

        function Refresh() {
            var t = $(".J_mainContent iframe");
            for (var i = 0; i < t.length; i++) {
                if ($(t[i]).css("display") != 'none') {
                    $(t[i]).attr("src", $(t[i]).attr("src"));
                }
            }
        }
        $(document).ready(function () {
            $('#modal_change_password').on('hidden.bs.modal', function (e) {
                var $form = $(this).find("form");
                if ($form)
                    $form[0].reset();
            });
            layer.closeAll('loading');
        });
    </script>
}






